package com.test.springcloudalibaba;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Desc TODO
 * ----------------
 * @CLASS_NAME: Controller
 * ----------------
 * @Author jovi
 * ----------------
 * @Date 2020-04-01 13:56
 */
@Slf4j
@RestController
@RefreshScope
public class Controller {

    @Value("${jovi.title}")
    private String title;

    @Resource
    private Config config;

    @GetMapping("/test")
    public String hello() {

        System.out.println(config.getName());
        return title;
    }
}
